<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>转换Julian Day计数到一个支持的历法。</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.cal-from-jd" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cal_from_jd</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">cal_from_jd</span> &mdash; <span class="dc-title">转换Julian Day计数到一个支持的历法。</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cal-from-jd-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>cal_from_jd</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$jd</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$calendar</code></span>
   ) : <span class="type">array</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>cal_from_jd()</strong></span>函数根据给定的Julian day的<code class="parameter">jd</code> 天数转换成特定历法<code class="parameter">calendar</code>中的日期。<code class="parameter">calendar</code>支持的值有<strong><code>CAL_GREGORIAN</code></strong>，<strong><code>CAL_JULIAN</code></strong>，<strong><code>CAL_JEWISH</code></strong> 和<strong><code>CAL_FRENCH</code></strong>。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cal-from-jd-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">jd</code></dt>

     <dd>

      <p class="para">
       一个Julian day天数的整数数字
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">calendar</code></dt>

     <dd>

      <p class="para">
       要转换成的历法
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.cal-from-jd-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
    返回一个数组，包含的历法信息有月，日，年，星期，星期的缩写和全写，月份的缩写和全写，日期的形式是“月/日/年”。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.cal-from-jd-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2643">
    <p><strong>Example #1 <span class="function"><strong>cal_from_jd()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$today&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">unixtojd</span><span style="color: #007700">(</span><span style="color: #0000BB">mktime</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">16</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2003</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">cal_from_jd</span><span style="color: #007700">(</span><span style="color: #0000BB">$today</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CAL_GREGORIAN</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [date] =&gt; 8/16/2003
    [month] =&gt; 8
    [day] =&gt; 16
    [year] =&gt; 2003
    [dow] =&gt; 6
    [abbrevdayname] =&gt; Sat
    [dayname] =&gt; Saturday
    [abbrevmonth] =&gt; Aug
    [monthname] =&gt; August
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.cal-from-jd-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="cal_to_jd.html" class="function" rel="rdfs-seeAlso">cal_to_jd()</a> - 从一个支持的历法转变为Julian Day计数。</span></li>
    <li class="member"><span class="function"><a href="jdtofrench.html" class="function" rel="rdfs-seeAlso">jdtofrench()</a> - 转变一个Julian Day计数到French Republican历法的日期</span></li>  
    <li class="member"><span class="function"><a href="jdtogregorian.html" class="function" rel="rdfs-seeAlso">jdtogregorian()</a> - 转变一个Julian Day计数为Gregorian历法日期</span></li>
    <li class="member"><span class="function"><a href="jdtojewish.html" class="function" rel="rdfs-seeAlso">jdtojewish()</a> - 转换一个julian天数为Jewish历法的日期</span></li>  
    <li class="member"><span class="function"><a href="jdtojulian.html" class="function" rel="rdfs-seeAlso">jdtojulian()</a> - 转变一个Julian Day计数到Julian历法的日期</span></li>
    <li class="member"><span class="function"><a href="jdtounix.html" class="function" rel="rdfs-seeAlso">jdtounix()</a> - 转变Julian Day计数为一个Unix时间戳</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>